export default {
    data() {
        return {
            visible:false,
            currRow:{},
            disabled:false
        }
    },
    computed: {},
    watch: {},
    created() {
    },
    mounted() {
    },
    methods: {
        toAdd(){
            this.visible = true
            this.disabled = false
            this.currRow = {}
        },
        toEdit(row){
            this.visible = true
            this.currRow = row
            this.disabled = false
        },
        toDetail(row){
            this.visible = true
            this.currRow = row
            this.disabled = true
        },
        toDelete(id,data){
            this.$confirm(
                "删除该条数据, 是否继续?",
                "提示",
                {
                    confirmButtonText: "确定",
                    cancelButtonText: "取消",
                    type: "warning"
                }
            ).then(() => {
                const api = require(`@/api/${this.apiUrl?this.apiUrl:this.$route.fullPath.split("?")[0].replace("/", "")
                }/index`);
                api.default.toDelete(id,data).then(res => {
                    this.msgSuccess("删除成功!");
                    this.getList()
                });
            });
        },
        toSearch(){

        },
        getList(params){
            this.$refs["myTable"].searchList(params)
        },
    }
}
